---
title: api_key.proto
hide_title: true
---

import { ProtoMessage, ProtoServiceMethod, ProtoEnum } from '@theme/ProtoFile';

# `api_key.proto`
_**path** mgmt/v1alpha1/api_key.proto_

_**package** mgmt.v1alpha1_



---

## Messages


### `AccountApiKey`
<ProtoMessage key={0} message={{"name":"AccountApiKey","longName":"AccountApiKey","fullName":"mgmt.v1alpha1.AccountApiKey","description":"","hasExtensions":false,"hasFields":true,"hasOneofs":true,"extensions":[],"fields":[{"name":"id","description":"The unique identifier of the API key","label":"","type":"string","longType":"string","fullType":"string","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""},{"name":"name","description":"The friendly name of the API Key","label":"","type":"string","longType":"string","fullType":"string","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""},{"name":"account_id","description":"The unique identifier of the account that the API key belongs to","label":"","type":"string","longType":"string","fullType":"string","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""},{"name":"created_by_id","description":"The unique identifier of the user that created the API key","label":"","type":"string","longType":"string","fullType":"string","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""},{"name":"created_at","description":"The timestamp of when the API key was created","label":"","type":"Timestamp","longType":"google.protobuf.Timestamp","fullType":"google.protobuf.Timestamp","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""},{"name":"updated_by_id","description":"The unique identifier of the user that last updated the API key","label":"","type":"string","longType":"string","fullType":"string","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""},{"name":"updated_at","description":"The timestamp of when the API key was last updated","label":"","type":"Timestamp","longType":"google.protobuf.Timestamp","fullType":"google.protobuf.Timestamp","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""},{"name":"key_value","description":"key_value is only returned on initial creation or when it is regenerated","label":"optional","type":"string","longType":"string","fullType":"string","ismap":false,"isoneof":true,"oneofdecl":"_key_value","defaultValue":""},{"name":"user_id","description":"The unique identifier of the user that the API key belongs to (Each API Key is associated with its own user record to identify what the API key does in the system)","label":"","type":"string","longType":"string","fullType":"string","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""},{"name":"expires_at","description":"The timestamp of what the API key expires and will not longer be usable.","label":"","type":"Timestamp","longType":"google.protobuf.Timestamp","fullType":"google.protobuf.Timestamp","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""}]}} />


### `CreateAccountApiKeyRequest`
<ProtoMessage key={1} message={{"name":"CreateAccountApiKeyRequest","longName":"CreateAccountApiKeyRequest","fullName":"mgmt.v1alpha1.CreateAccountApiKeyRequest","description":"","hasExtensions":false,"hasFields":true,"hasOneofs":false,"extensions":[],"fields":[{"name":"account_id","description":"The unique identifier of the account to create the API key for.","label":"","type":"string","longType":"string","fullType":"string","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""},{"name":"name","description":"The friendly name of the API key","label":"","type":"string","longType":"string","fullType":"string","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""},{"name":"expires_at","description":"Validate between now and one year: now < x < 365 days","label":"","type":"Timestamp","longType":"google.protobuf.Timestamp","fullType":"google.protobuf.Timestamp","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""}]}} />


### `CreateAccountApiKeyResponse`
<ProtoMessage key={2} message={{"name":"CreateAccountApiKeyResponse","longName":"CreateAccountApiKeyResponse","fullName":"mgmt.v1alpha1.CreateAccountApiKeyResponse","description":"","hasExtensions":false,"hasFields":true,"hasOneofs":false,"extensions":[],"fields":[{"name":"api_key","description":"The created API key","label":"","type":"AccountApiKey","longType":"AccountApiKey","fullType":"mgmt.v1alpha1.AccountApiKey","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":"","typeLink":"/api/mgmt/v1alpha1/api_key.proto#accountapikey"}]}} />


### `DeleteAccountApiKeyRequest`
<ProtoMessage key={3} message={{"name":"DeleteAccountApiKeyRequest","longName":"DeleteAccountApiKeyRequest","fullName":"mgmt.v1alpha1.DeleteAccountApiKeyRequest","description":"","hasExtensions":false,"hasFields":true,"hasOneofs":false,"extensions":[],"fields":[{"name":"id","description":"The unique identifier of the API key to delete.","label":"","type":"string","longType":"string","fullType":"string","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""}]}} />


### `DeleteAccountApiKeyResponse`
<ProtoMessage key={4} message={{"name":"DeleteAccountApiKeyResponse","longName":"DeleteAccountApiKeyResponse","fullName":"mgmt.v1alpha1.DeleteAccountApiKeyResponse","description":"","hasExtensions":false,"hasFields":false,"hasOneofs":false,"extensions":[],"fields":[]}} />


### `GetAccountApiKeyRequest`
<ProtoMessage key={5} message={{"name":"GetAccountApiKeyRequest","longName":"GetAccountApiKeyRequest","fullName":"mgmt.v1alpha1.GetAccountApiKeyRequest","description":"","hasExtensions":false,"hasFields":true,"hasOneofs":false,"extensions":[],"fields":[{"name":"id","description":"The unique identifier of the API key to get.","label":"","type":"string","longType":"string","fullType":"string","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""}]}} />


### `GetAccountApiKeyResponse`
<ProtoMessage key={6} message={{"name":"GetAccountApiKeyResponse","longName":"GetAccountApiKeyResponse","fullName":"mgmt.v1alpha1.GetAccountApiKeyResponse","description":"","hasExtensions":false,"hasFields":true,"hasOneofs":false,"extensions":[],"fields":[{"name":"api_key","description":"The API key that was retrieved.","label":"","type":"AccountApiKey","longType":"AccountApiKey","fullType":"mgmt.v1alpha1.AccountApiKey","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":"","typeLink":"/api/mgmt/v1alpha1/api_key.proto#accountapikey"}]}} />


### `GetAccountApiKeysRequest`
<ProtoMessage key={7} message={{"name":"GetAccountApiKeysRequest","longName":"GetAccountApiKeysRequest","fullName":"mgmt.v1alpha1.GetAccountApiKeysRequest","description":"","hasExtensions":false,"hasFields":true,"hasOneofs":false,"extensions":[],"fields":[{"name":"account_id","description":"The unique identifier of the account to get the API keys for.","label":"","type":"string","longType":"string","fullType":"string","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""}]}} />


### `GetAccountApiKeysResponse`
<ProtoMessage key={8} message={{"name":"GetAccountApiKeysResponse","longName":"GetAccountApiKeysResponse","fullName":"mgmt.v1alpha1.GetAccountApiKeysResponse","description":"","hasExtensions":false,"hasFields":true,"hasOneofs":false,"extensions":[],"fields":[{"name":"api_keys","description":"The list of API keys for the account.","label":"repeated","type":"AccountApiKey","longType":"AccountApiKey","fullType":"mgmt.v1alpha1.AccountApiKey","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":"","typeLink":"/api/mgmt/v1alpha1/api_key.proto#accountapikey"}]}} />


### `RegenerateAccountApiKeyRequest`
<ProtoMessage key={9} message={{"name":"RegenerateAccountApiKeyRequest","longName":"RegenerateAccountApiKeyRequest","fullName":"mgmt.v1alpha1.RegenerateAccountApiKeyRequest","description":"","hasExtensions":false,"hasFields":true,"hasOneofs":false,"extensions":[],"fields":[{"name":"id","description":"The unique identifier of the API key to regenerate.","label":"","type":"string","longType":"string","fullType":"string","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""},{"name":"expires_at","description":"Validate between now and one year: now < x < 365 days","label":"","type":"Timestamp","longType":"google.protobuf.Timestamp","fullType":"google.protobuf.Timestamp","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":""}]}} />


### `RegenerateAccountApiKeyResponse`
<ProtoMessage key={10} message={{"name":"RegenerateAccountApiKeyResponse","longName":"RegenerateAccountApiKeyResponse","fullName":"mgmt.v1alpha1.RegenerateAccountApiKeyResponse","description":"","hasExtensions":false,"hasFields":true,"hasOneofs":false,"extensions":[],"fields":[{"name":"api_key","description":"The regenerated API key","label":"","type":"AccountApiKey","longType":"AccountApiKey","fullType":"mgmt.v1alpha1.AccountApiKey","ismap":false,"isoneof":false,"oneofdecl":"","defaultValue":"","typeLink":"/api/mgmt/v1alpha1/api_key.proto#accountapikey"}]}} />

---
## Services


### `ApiKeyService`

Service that manages the lifecycle of API Keys that are associated with a specific Account.


#### `GetAccountApiKeys`
<ProtoServiceMethod key={'GetAccountApiKeys-0'} method={{"name":"GetAccountApiKeys","description":"Retrieves a list of Account API Keys","requestType":"GetAccountApiKeysRequest","requestLongType":"GetAccountApiKeysRequest","requestFullType":"mgmt.v1alpha1.GetAccountApiKeysRequest","requestStreaming":false,"responseType":"GetAccountApiKeysResponse","responseLongType":"GetAccountApiKeysResponse","responseFullType":"mgmt.v1alpha1.GetAccountApiKeysResponse","responseStreaming":false,"options":{"idempotency_level":"NO_SIDE_EFFECTS"},"requestTypeLink":"/api/mgmt/v1alpha1/api_key.proto#getaccountapikeysrequest","responseTypeLink":"/api/mgmt/v1alpha1/api_key.proto#getaccountapikeysresponse"}} />


#### `GetAccountApiKey`
<ProtoServiceMethod key={'GetAccountApiKey-1'} method={{"name":"GetAccountApiKey","description":"Retrieves a single API Key","requestType":"GetAccountApiKeyRequest","requestLongType":"GetAccountApiKeyRequest","requestFullType":"mgmt.v1alpha1.GetAccountApiKeyRequest","requestStreaming":false,"responseType":"GetAccountApiKeyResponse","responseLongType":"GetAccountApiKeyResponse","responseFullType":"mgmt.v1alpha1.GetAccountApiKeyResponse","responseStreaming":false,"options":{"idempotency_level":"NO_SIDE_EFFECTS"},"requestTypeLink":"/api/mgmt/v1alpha1/api_key.proto#getaccountapikeyrequest","responseTypeLink":"/api/mgmt/v1alpha1/api_key.proto#getaccountapikeyresponse"}} />


#### `CreateAccountApiKey`
<ProtoServiceMethod key={'CreateAccountApiKey-2'} method={{"name":"CreateAccountApiKey","description":"Creates a single API Key\nThis method will return the decrypted contents of the API key","requestType":"CreateAccountApiKeyRequest","requestLongType":"CreateAccountApiKeyRequest","requestFullType":"mgmt.v1alpha1.CreateAccountApiKeyRequest","requestStreaming":false,"responseType":"CreateAccountApiKeyResponse","responseLongType":"CreateAccountApiKeyResponse","responseFullType":"mgmt.v1alpha1.CreateAccountApiKeyResponse","responseStreaming":false,"requestTypeLink":"/api/mgmt/v1alpha1/api_key.proto#createaccountapikeyrequest","responseTypeLink":"/api/mgmt/v1alpha1/api_key.proto#createaccountapikeyresponse"}} />


#### `RegenerateAccountApiKey`
<ProtoServiceMethod key={'RegenerateAccountApiKey-3'} method={{"name":"RegenerateAccountApiKey","description":"Regenerates a single API Key with a new expiration time\nThis method will return the decrypted contents of the API key","requestType":"RegenerateAccountApiKeyRequest","requestLongType":"RegenerateAccountApiKeyRequest","requestFullType":"mgmt.v1alpha1.RegenerateAccountApiKeyRequest","requestStreaming":false,"responseType":"RegenerateAccountApiKeyResponse","responseLongType":"RegenerateAccountApiKeyResponse","responseFullType":"mgmt.v1alpha1.RegenerateAccountApiKeyResponse","responseStreaming":false,"requestTypeLink":"/api/mgmt/v1alpha1/api_key.proto#regenerateaccountapikeyrequest","responseTypeLink":"/api/mgmt/v1alpha1/api_key.proto#regenerateaccountapikeyresponse"}} />


#### `DeleteAccountApiKey`
<ProtoServiceMethod key={'DeleteAccountApiKey-4'} method={{"name":"DeleteAccountApiKey","description":"Deletes an API Key from the system.","requestType":"DeleteAccountApiKeyRequest","requestLongType":"DeleteAccountApiKeyRequest","requestFullType":"mgmt.v1alpha1.DeleteAccountApiKeyRequest","requestStreaming":false,"responseType":"DeleteAccountApiKeyResponse","responseLongType":"DeleteAccountApiKeyResponse","responseFullType":"mgmt.v1alpha1.DeleteAccountApiKeyResponse","responseStreaming":false,"requestTypeLink":"/api/mgmt/v1alpha1/api_key.proto#deleteaccountapikeyrequest","responseTypeLink":"/api/mgmt/v1alpha1/api_key.proto#deleteaccountapikeyresponse"}} />


---


  